<?php
namespace Admin\Model;
use Think\Model;
class AdminModel extends Model {
    protected $_validate = array(
        array('email','require','电子邮箱不能为空！'),
        array('email','email','电子邮箱错误！'),
        array('password','require','密码不能为空！'),
        array('repassword','password','两次密码不一致！',0,'confirm'),
        array('email','','电子邮箱已经存在！',0,'unique',4),
    );

    protected $_map = array(

    );

    protected $_auto = array(
        array('password','md5',3,'function') ,
        array('addtime','time',3,'function') ,
    );

    public function islogin($map){
        $result = $this->where($map)->find();
        if(!$result){
            return -1;
        }else{
            return $result;
        }
    }


}